package cn.denny.designpattern.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxy implements InvocationHandler{

	private Object target;
	public DynamicProxy(Object obj){
		this.target = obj;
	}
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		System.out.println("Dynamic prox before");
		Object rs =method.invoke(target, args);
		System.out.println("Dynamic prox after");
		return rs;
	}

}
